import request from '@/utils/request'

// 查询优惠卷列表
export function listTemplate(query) {
  return request({
    url: '/operation/couponTemplate/getCouponList',
    method: 'post',
    data: query
  });
}

// 查询优惠卷详细
export function getTemplate(id) {
  return request({
    url: '/operation/couponTemplate/getCouponById/' + id,
    method: 'get'
  })
}

// 新增优惠卷
export function addTemplate(data) {
  return request({
    url: '/operation/couponTemplate/addCoupon',
    method: 'post',
    data: data
  })
}

// 修改优惠卷
export function updateTemplate(data) {
  return request({
    url: '/operation/couponTemplate/updateCoupon',
    method: 'put',
    data: data
  })
}

// 删除优惠卷
export function delTemplate(id) {
  return request({
    url: '/operation/couponTemplate/deleteCoupon/' + id,
    method: 'delete'
  })
}

